home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / infosrvr / dev / www_talk.930 / 000345_connolly@pixel.convex.com _Thu Nov 19 05:43:14 1992.msg < prev    next >
Internet Message Format  |  1994-01-24  |  2KB

  1. Return-Path: <connolly@pixel.convex.com>
  2. Received: from dxmint.cern.ch by  nxoc01.cern.ch  (NeXT-1.0 (From Sendmail 5.52)/NeXT-2.0)
  3.     id AA12924; Thu, 19 Nov 92 05:43:14 MET
  4. Received: by dxmint.cern.ch (dxcern) (5.57/3.14)
  5.     id AA07607; Thu, 19 Nov 92 05:55:47 +0100
  6. Received: from convex.convex.com by mcsun.EU.net with SMTP
  7.     id AA16779 (5.65b/CWI-2.187); Thu, 19 Nov 1992 05:55:31 +0100
  8. Received: from pixel.convex.com by convex.convex.com (5.64/1.35)
  9.     id AA26388; Wed, 18 Nov 92 22:54:12 -0600
  10. Received: from localhost by pixel.convex.com (5.64/1.28)
  11.     id AA08886; Wed, 18 Nov 92 22:54:11 -0600
  12. Message-Id: <9211190454.AA08886@pixel.convex.com>
  13. To: marca@ncsa.uiuc.edu (Marc Andreessen)
  14. Cc: www-talk@nxoc01.cern.ch
  15. Subject: Re: html-mode.el update 
  16. In-Reply-To: Your message of "Wed, 18 Nov 92 21:42:37 PST."
  17.              <9211190542.AA09366@wintermute.ncsa.uiuc.edu> 
  18. Date: Wed, 18 Nov 92 22:54:10 CST
  19. From: Dan Connolly <connolly@pixel.convex.com>
  20.  
  21.  
  22. Here's a patch to add a function to fix all the existing
  23. HREFs in an HTML file so they'll have quotes around them.
  24.  
  25. Dan
  26.  
  27. *** /mnt/connolly/foo    Wed Nov 18 22:51:50 1992
  28. --- html-mode.el    Wed Nov 18 22:50:32 1992
  29. ***************
  30. *** 517,522 ****
  31. --- 517,543 ----
  32.                  (setq html-link-counter (1+ html-link-counter))
  33.                  (replace-string-in-buffer start (1- end)
  34.                   (format "%d" html-link-counter))))))))
  35. + (defun html-quote-hrefs ()
  36. +   "Insert quotes around all HREF attribute value literals.
  37. + This remedies the problem with old html files that can't be
  38. + processed by SGML parsers. That is, changes
  39. + <A HREF=foo> to <A HREF="foo">.
  40. + By Dan Connolly, so don't yell at Mark if it breaks."
  41. +   (interactive)
  42. +   (save-excursion
  43. +     (goto-char (point-min))
  44. +     (setq html-link-counter 0)
  45. +     (while (re-search-forward "<[aA][ \t\n]+\\([nN][aA][mM][eE]=[a-zA-Z0-9]+[ \t\n]+\\)?[hH][rR][eE][fF]=" (point-max) t)
  46. +       (cond ((null (looking-at "\""))
  47. +          (insert "\"")
  48. +          (re-search-forward "[ \t\n>]" (point-max) t)
  49. +          (forward-char -1)
  50. +          (insert "\"")
  51. +          ))
  52. +       ) ) )
  53.   
  54.   ;;; ------------------------------- html-mode --------------------------------
  55.